﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AreasSearch.aspx.cs" Inherits="VentaPorCatalogos.Pages.AreasSearch" %>


<%@ Register Src="~/UserControls/Paginador.ascx" TagName="Paginador" TagPrefix="uc1" %>
<%@ Import Namespace="BE" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <link href="~/includes/jquery-ui-1.10.2.custom/css/smoothness/jquery-ui-1.10.2.custom.css"
        rel="stylesheet" type="text/css" />
    <link href="~/includes/css/Estilos.css" rel="stylesheet" type="text/css" />
    <script src='<%=Page.ResolveUrl("~/includes/jquery-ui-1.10.2.custom/js/jquery-1.9.1.js")%>'
        type="text/javascript"></script>
    <script src='<%=Page.ResolveUrl("~/includes/jquery-ui-1.10.2.custom/js/jquery-ui-1.10.2.custom.js")%>'
        type="text/javascript"></script>
    <script src='<%=Page.ResolveUrl("~/includes/jquery-validation-1.11.0/jquery.validate.js")%>'
        type="text/javascript"></script>
    <script src='<%=Page.ResolveUrl("~/includes/js/Funciones.js")%>' type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function () {
            FormatoGrillasSeleccionables();

        }
        );

        function Seleccionar(id, text) {
            var o = new Object();
            o.id = id;
            o.text = text;
            window.returnValue = o;
            window.close();
        }

    </script>
    <title></title>
    <base target="_self" />
</head>
<body class="BusquedaModal">
    <div class="titulo">
        <span class="texto_titulo">BUSQUEDA DE AREAS</span>
    </div>
    <form id="form1" runat="server">
    <div id="divBuscar" class="Buscar">
        <div id="divFiltros">
            <fieldset>
                <legend>Filtrar</legend>
                <div class="field">
                    <asp:Label ID="lblId" AssociatedControlID="txtIdFiltro" runat="server" EnableViewState="false"
                        Text="Cód. Area:"></asp:Label>
                    <asp:TextBox ID="txtIdFiltro" runat="server"></asp:TextBox>
                </div>
                <div class="field">
                    <asp:Label ID="lblDescripcionFiltro" AssociatedControlID="txtDescripcionFiltro" runat="server"
                        EnableViewState="false" Text="Descripción:"></asp:Label>
                    <asp:TextBox ID="txtDescripcionFiltro" runat="server"></asp:TextBox>                    
                </div>
                <div class="field">
                    <asp:Label ID="lblZona" AssociatedControlID="ddlZona" runat="server" EnableViewState="false"
                        Text="Zona:"></asp:Label>
                    <asp:DropDownList ID="ddlZona" runat="server" AutoPostBack="true">
                    </asp:DropDownList>
                    <asp:Button ID="btnFiltrar" runat="server" Text="Filtrar" OnClick="btnFiltrar_Click" />
                </div>
            </fieldset>
        </div>
        <div id="divResultados">
            <fieldset>
                <legend>Resultados</legend>
                <div id="divGrid">
                    <asp:GridView ID="gdvSearch" runat="server" AutoGenerateColumns="False" DataKeyNames="IdArea"
                        ShowHeaderWhenEmpty="true" OnRowCommand="gdvSearch_RowCommand" CssClass="selectableGridView"
                        GridLines="Horizontal">
                        <Columns>
                            <asp:BoundField DataField="IdArea" HeaderText="Cód." ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Center" />
                            <asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-Width="300px"
                                HeaderStyle-HorizontalAlign="Left" />
                            <asp:TemplateField HeaderText="Zona" ItemStyle-Width="200px">
                                <ItemTemplate>                                 
                                    <%# ((AreaBE)Container.DataItem).oZonaBE.Descripcion %>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <SelectedRowStyle CssClass="SelectedRow" />
                        <EmptyDataTemplate>
                            <asp:Label runat="server" ID="lblSinDatos" Text="Sin datos cargados."></asp:Label>
                        </EmptyDataTemplate>
                    </asp:GridView>
                </div>
            </fieldset>
        </div>
        <uc1:Paginador ID="pagGrilla" runat="server" OnComandoPagina="pagGrilla_OnComandoPagina" />
    </div>
    <div class="Botonera">
        <fieldset>
            <legend>Acciones</legend><span class="ContenedorBotones">
                <asp:Button ID="btnAceptar" runat="server" Text="Aceptar" OnClick="btnAceptar_Click" />
                <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" OnClick="btnCancelar_Click" />
            </span>
        </fieldset>
    </div>
    </form>
</body>
</html>
